package com.dyypdadmin.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dyypdadmin.pojo.Administrators;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface AdministratorDao extends BaseMapper<Administrators> {
    //根据账号密码查找用户
    @Select("SELECT * FROM `Administrators` where email=#{email} and password=#{password}")
    Administrators getAdminByEmailAndPassword(@Param("email")String email, @Param("password") String password);
    //修改管理员密码
    @Update("update administrators set password=#{password} where uid=#{uid}")
    int updateAdminPassword(@Param("uid")Integer uid,@Param("password")String password);

}
